import request from '@/utils/request'

// 查询活动列表列表
export function listActivity(query) {
  return request({
    url: '/docs/activity/list',
    method: 'get',
    params: query
  })
}

// 查询活动列表详细
export function getActivity(activityId) {
  return request({
    url: '/docs/activity/' + activityId,
    method: 'get'
  })
}

// 新增活动列表
export function addActivity(data) {
  return request({
    url: '/docs/activity',
    method: 'post',
    data: data
  })
}

// 修改活动列表
export function updateActivity(data) {
  return request({
    url: '/docs/activity',
    method: 'put',
    data: data
  })
}

// 删除活动列表
export function delActivity(activityId) {
  return request({
    url: '/docs/activity/' + activityId,
    method: 'delete'
  })
}

export function getActivityTree(data) {
    return request({
        url: '/docs/activity/getActivityTree',
        method: 'post',
        data: data
    })
}
export function changeActivityStatus(activityId, status) {
    const data = {
        activityId,
        status
    }
    return request({
        url: '/docs/activity/changeStatus',
        method: 'put',
        data: data
    })
}
